package cn.wolfcode.crm.web.controller;


import cn.wolfcode.crm.domain.Saleorder;
import cn.wolfcode.crm.qo.PageResult;
import cn.wolfcode.crm.qo.SaleorderQueryObject;
import cn.wolfcode.crm.service.ISaleorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
@RequestMapping("saleorder")
@Controller
public class SaleorderController {
    @Autowired
    private ISaleorderService saleorderService;


    @RequestMapping("selectAll")
    @ResponseBody
    public List<Saleorder> selectAll() {
        return saleorderService.selectAll();
    }


    @RequestMapping("view")
    public String view() {
        return "saleorder/list";
    }



    @RequestMapping("query")
    @ResponseBody
    public PageResult query(SaleorderQueryObject qo) {
        PageResult result = saleorderService.query(qo);
        return result;
    }


    @RequestMapping("memberPurchaseRecord")
    @ResponseBody
    public Object memberPurchaseRecord(SaleorderQueryObject qo) {

        List<HashMap<String,Object>> list = saleorderService.selectMemberPurchaseRecord(qo);

        return list;
    }
}
